#! /bin/bash
echo $NVM_BIN
npmLink=/usr/local/bin/npm
nodeLink=/usr/local/bin/node
if [ -f "$npmLink" ]
then
    echo "$npmLink 存在"
    echo "删除原来的link"
    sudo rm $npmLink
else
    echo "$npmLink 不存在"
fi

echo "创建新的link"
sudo ln -s $NVM_BIN/npm $npmLink

if [ -f "$nodeLink" ]
then
    echo "$nodeLink 存在"
    echo "删除原来的link"
    sudo rm $nodeLink
else
    echo "$nodeLink 不存在"
fi

echo "创建新的link"
sudo ln -s $NVM_BIN/node $nodeLink

if [ -f "$nodeLink" ]
then
    if [ -f "$npmLink" ]
    then
        echo "创建全局node成功"
    fi
fi
